﻿using Microsoft.ApplicationServer.Caching;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace Microsoft.Ted.Wacel.Demo.Web.Controllers
{
    public class TableDataController : ApiController
    {
        [HttpGet]
        public List<Customer> GetTable(string partition, string startId, string endId)
        {
            Table<Customer> table = new Table<Customer>("Company", "Id", ConfigurationManager.AppSettings["StorageClient"], "customers",
                new DataCache("customers"));
            return table.List(startId, endId, partition, partition).ToList();
        }
    }
}
